package com.sikaryofficial.information.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author wuweihong
 * @create 2024/9/19 - 15:26
 * @description: 支持的语言种类枚举
 **/
@Getter
@AllArgsConstructor
public enum LanguageEnum {

    EN_US("en_US", "English/英文"),
    ZH_CN("zh_CN", "Chinese/中文");

    private final String value;
    private final String desc;

    public static LanguageEnum getByValue(String value) {

        return Arrays.stream(LanguageEnum.values())
                .filter(pointRuleEnum -> Objects.nonNull(value) && pointRuleEnum.getValue().equals(value))
                .findFirst().orElse(null);

    }

}
